import { createRouter, createWebHistory } from "vue-router";
import { useUserStore } from "@/stores/user";
import _ from "@/utils/local";
import pinia from "@/stores";
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name: "/",
      redirect: "home",
      component: () => import("@/components/Layout/index.vue"),
      children: [
        {
          path: "/Home",
          name: "home",
          component: () => import("@/views/Home.vue"),
        },
        {
          path: "/Inn",
          name: "inn",
          component: () => import("@/views/Inn.vue"),
        },
        {
          path: "/Forumpark",
          name: "forumpark",
          component: () => import("@/views/Forumpark.vue"),
        },
        {
          path: "/P",
          name: "p",
          component: () => import("@/views/P.vue"),
        },
      ],
    },
    {
      path: "/Login",
      name: "login",
      component: () => import("@/views/Login.vue"),
    },
    {
      path: "/Register",
      name: "register",
      component: () => import("@/views/Register.vue"),
    },
    {
      path: "/CreateTieba",
      name: "createTieba",
      component: () => import("@/views/CreateTieba.vue"),
    },
  ],
});

export default router;
